﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WUEnterPriseSpaceLeftBook.ascx.cs"
    Inherits="NJL.Web.Controls.WUEnterPriseSpaceLeftBook" %>
<%@ Import Namespace="Royalsoft.Common" %>
<script type="text/javascript">

    var collection = function (collectionId) {
        $.ajax({
            type: 'get',
            url: '/Handle/Handler.ashx',
            data: 'collection=' + collectionId + '&collType=1&Random=' + Math.random(),
            dataType: 'text',
            success: function (msg) {
                if (msg == "NoSession") {
                    alert("请登录后再操作");
                    window.location.href = '/Login.aspx?url=' + document.location.href;
                }
                else if (msg == "False") {
                    alert("您已经关注过");
                }
                else {
                    alert(" 关注成功啦，您是我们这儿第 " + msg + " 关注者，有时间就过来坐坐吧。点确定继续参观~");
                }

            },
            error: function () {
                alert("评论失败");
            }
        })
    }
    var remind = function () {
        $.ajax({
            type: 'get',
            url: '/Handle/Handler.ashx',
            data: 'remind=<%=Request.QueryString["id"] %>&Random=' + Math.random(),
            dataType: 'text',
            success: function (msg) {
                if (msg == "True") {
                    alert("提醒成功");
                }
            },
            error: function () {

            }
        })
    }
   
</script>
<%
    if (modelCompany.IS_OPEN_BOOK == 1 && LIST_BOOK.Count != 0)
    {
%>
<div>
    <div class="righttitle">
        <h2>
            预订信息</h2>
    </div>
    <div style="border:1px solid #ddd;padding:1px;">
        <table class="tab" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <th>
                    类型
                </th>
                <th>
                    门市价
                </th>
                <th>
                    预定价
                </th>
                <th>
                    支付方式
                </th>
                <th width="235px">
                    预付
                </th>
            </tr>
            <%
                for (int i = 0; i < LIST_BOOK.Count; i++)
                {
            %>
            <tr>
                <td style="text-align: left">
                    <a href='/CompanyOrder.aspx?id=<%=Request.QueryString["id"] %>&bid=<%=LIST_BOOK[i].ID %>'
                        style='color: #195CB5' title='<%=LIST_BOOK[i].BOOK_INTRO %>' target="_blank">
                        <%=PageValidate.SqlText(LIST_BOOK[i].BOOK_NAME,5)%></a>
                  <%=!string.IsNullOrEmpty(LIST_BOOK[i].BOOK_INTRO)?"(":""%><%=!string.IsNullOrEmpty(LIST_BOOK[i].BOOK_INTRO) && LIST_BOOK[i].BOOK_INTRO.Length>10 ? LIST_BOOK[i].BOOK_INTRO.Substring(0, 10) : LIST_BOOK[i].BOOK_INTRO%>  <%=!string.IsNullOrEmpty(LIST_BOOK[i].BOOK_INTRO)?")":""%>
                </td>
                <td>
                    <del>¥<%=LIST_BOOK[i].MARKET_PRICE.Value.ToString("#")%></del>
                </td>
                <td>
                    <strong class="orange">¥<%=LIST_BOOK[i].LOCAL_PRICE.Value.ToString("#")%></strong>
                </td>
                <td>
                    <%=GetBookPayType(LIST_BOOK[i].NJL_CS_BOOK_PAY_TYPE_CODE)%>
                    <span>
                        <%-- <a href="/CompanyOrder.aspx?id=<%=Request.QueryString["id"]%>&bid=<%=LIST_BOOK[i].ID%>" target="_blank" <%if(LIST_BOOK[i].NJL_CS_BOOK_PAY_TYPE_CODE=="1") Response.Write("class=\"ding02\""); else Response.Write("class=\"ding\""); %>
                        style="cursor: pointer"></a>--%>
                    </span>
                </td>
                <td>
                    <span class="ordain">
                        <a target="_blank" title="注册后预定，能马上收到短信" href="/CompanyOrder.aspx?id=<%=Request.QueryString["id"]%>&bid=<%=LIST_BOOK[i].ID%>">预定</a> 
                    </span>
                    <span class="ordain_no">
                        <a target="_blank" title="不注册预定，您只能在我们确认后才能收到短信" href="/CompanyOrder2.aspx?id=<%=Request.QueryString["id"]%>&bid=<%=LIST_BOOK[i].ID%>">不想注册，直接预定</a>
                    </span>
                </td>
            </tr>
            <%
                }
            %>
        </table>
    </div>
</div>
<div style="border-bottom:1px solid #dddddd">
    <div class="righttitle">
        <h2>
            预订须知</h2>
    </div>
    <div>
    <%=modelCompany.TICKET_NOTICE %>
    </div>
</div>
<%  
    }
    else if (LIST_BOOK.Count == 0)
    {
%>
<script type="text/javascript">
    function remindCount() {
        $.ajax({
            type: 'get',
            url: '/Handle/Handler.ashx',
            data: 'remindCountId=<%=Request.QueryString["id"] %>&Random=' + Math.random(),
            dataType: 'text',
            success: function (msg) {
                document.getElementById("remindCount").innerHTML = msg;
            },
            error: function () {

            }

        });
    }
    $(document).ready(function () {
        remindCount();
    });
</script>
<div class="blank">
</div>
<div>
    <img id="opendingpiao1" src="/Images/kaitong.jpg" alt="点击查看联系方式" title="点击查看联系方式"
        style="cursor: pointer" />
</div>
<div class="blk popup_main" style="width: 758px; height: 318px;" id="blk9dingpiao1">
    <div class="popup_title popup_title02">
        <span class="float_r"><a href="javascript:void(0)" class="close" title="关闭" id="close9dingpiao1">
        </a></span>
    </div>
    <div class="popcont">
        <!--left-->
        <div class="float_l w_340 popleftbor">
            <h2>
                <strong>此商铺还未进行预定授权</strong></h2>
            <div class="font14">
                <p>
                    <strong>作为一个严谨的游客</strong>,如果您</p>
                <dl class="list">
                    <dt class="icon_dot">想去这里玩</dt>
                    <dd>
                        提醒用户开通预定功能，享受优惠，快乐出游</dd>
                    <dd class="float_r">
                        <a href="javascript:remind();remindCount()" class="btn_remind" title="立刻提醒"></a>
                    </dd>
                    <dd>
                        该商铺已被提醒<strong id="remindCount"></strong>次
                    </dd>
                </dl>
                <dl class="list cleanFlex">
                    <dt class="icon_dot">对这里很感兴趣</dt>
                    <dd>
                        不妨关注一下，时时了解优惠信息，想怎么玩就怎么玩</dd>
                    <dd class="float_r">
                        <a style="cursor: pointer" id="guanzhu1" class="btn_atten" title="关注一下" <%if(UserId!=""){Response.Write("onclick=\"collection('"+Request.QueryString["id"]+"')\"");} %>
                            id="guanzhu"></a>
                    </dd>
                </dl>
            </div>
        </div>
        <!--right-->
        <div class="float_r w_366">
            <h2>
                <strong>开通预定功能</strong></h2>
            <div class="popcontact font14">
                <p>
                    如果您是该商铺的负责人，请联系我们为您开通预定功能</p>
                <p class="m_top_10">
                    <strong class="font14">联系方式</strong></p>
                <p>
                    电话：<span class="orange"><%=MODEL_BASE.WEBSITE_CONTACT_TEL%></span>&nbsp;<span><%=MODEL_BASE.WEBSITE_CONTACT%></span></p>
                <p>
                    在线QQ：<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=<%=MODEL_BASE.WEBSITE_CONTACT_QQ %>&site=qq&menu=yes"><img
                        border="0" src="http://wpa.qq.com/pa?p=2:<%=MODEL_BASE.WEBSITE_CONTACT_QQ %>:41"
                        alt="点击这里给我发消息" title="点击这里给我发消息" align="absmiddle" /></a></p>
                <p>
                    邮箱：<strong class="bluelink"><a href="mailto:<%=MODEL_BASE.WEBSITE_CONTACT_EMAIL%>"><%=MODEL_BASE.WEBSITE_CONTACT_EMAIL%></a></strong></p>
            </div>
            <!--提示-->
            <div class="popPrompt">
                <p>
                    本站目前已有开通预定功能的商户<strong class="orange"><asp:Literal ID="litBookCount" runat="server"></asp:Literal></strong>家，已成交<strong
                        class="orange"><asp:Literal ID="litOrderNum" runat="server"></asp:Literal></strong>笔。<strong
                            class="orange"><asp:Literal ID="litOrderCount" runat="server"></asp:Literal></strong>人通过预订放心的安排行程，享受了乡村旅游快乐！</p>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    //示例9，综合效果
    var dingpiao = new PopupLayer({ trigger: "#opendingpiao1", popupBlk: "#blk9dingpiao1", closeBtn: "#close9dingpiao1", useOverlay: true, useFx: true,
        offsets: {
            x: 0,
            y: -41
        }
    });
    dingpiao.doEffects = function (way) {
        if (way == "open") {
            this.popupLayer.css({ opacity: 0.3 }).show(400, function () {
                this.popupLayer.animate({
                    left: ($(document).width() - this.popupLayer.width()) / 2,
                    top: (document.documentElement.clientHeight - this.popupLayer.height()) / 2 + $(document).scrollTop(),
                    opacity: 0.8
                }, 1000, function () { this.popupLayer.css("opacity", 1) } .binding(this));
            } .binding(this));
            // document.getElementById('Logindingpiao').src = '<%=WEBSITE_USRE_DOMAIN %>/SecondLogin.aspx?websitecode=<%=WEBSITE_CODE %>&domain=<%=WEBSITE_DOMAIN %>&url=<%=Request.RawUrl %>';
        }
        else {
            this.popupLayer.animate({
                left: this.trigger.offset().left,
                top: this.trigger.offset().top,
                opacity: 0.1
            }, { duration: 500, complete: function () { this.popupLayer.css("opacity", 1); this.popupLayer.hide() } .binding(this) });
        }
    }

</script>
<%
    }

%>
<%
    if (UserId == "" || UserName == "")
    {
%>
<script language="javascript" type="text/javascript">
    $(document).ready(function () {
        //示例9，综合效果
        var guanzhu = new PopupLayer({ trigger: "#guanzhu1", popupBlk: "#divguanzhu1", closeBtn: "#closeguanzhu1", useOverlay: true, useFx: true,
            offsets: {
                x: 0,
                y: -41
            }
        });
        guanzhu.doEffects = function (way) {
            if (way == "open") {
                this.popupLayer.css({ opacity: 0.3 }).show(400, function () {
                    this.popupLayer.animate({
                        left: ($(document).width() - this.popupLayer.width()) / 2,
                        top: (document.documentElement.clientHeight - this.popupLayer.height()) / 2 + $(document).scrollTop(),
                        opacity: 0.8
                    }, 1000, function () { this.popupLayer.css("opacity", 1) } .binding(this));
                } .binding(this));
                dingpiao.close();
                document.getElementById('Iframeguanzhu1').src = '<%=WEBSITE_USRE_DOMAIN %>/SecondLogin.aspx?websitecode=<%=WEBSITE_CODE %>&domain=<%=WEBSITE_DOMAIN %>&url=<%=Request.RawUrl %>';
            }
            else {
                this.popupLayer.animate({
                    left: this.trigger.offset().left,
                    top: this.trigger.offset().top,
                    opacity: 0.1
                }, { duration: 500, complete: function () { this.popupLayer.css("opacity", 1); this.popupLayer.hide() } .binding(this) });
            }
        }

    });
</script>
<!--添加关注-->
<div id="divguanzhu1" class="blk">
    <div class="popup_title">
        <span class="float_r"><a href="javascript:void(0)" id="closeguanzhu1">关闭</a></span>
        <ul>
            <li class="now"><a target="main">登录</a> </li>
        </ul>
    </div>
    <div>
        <iframe id="Iframeguanzhu1" name="main" width="500" height="420" style="overflow: hidden;
            border: none;"></iframe>
    </div>
</div>
<%
    }
%>
